<div class="container">
    <div ng-controller="statisticController">
        <div class="row">
            <div class="col-sm-12">
                <uib-tabset>
                    <uib-tab active="true">
                        <uib-tab-heading><label>系统用户</label> <label class="badge">{{result.userCount}}</label></uib-tab-heading>
                        <br/>
                        <div ng-controller="statisticUserController">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline">
                                        <div class="form-group">
                                            <input name="userName" type="text" class="form-control input-sm" ng-model="searchRequest.userName" placeholder="用户名"/>
                                        </div>
                                        <div class="form-group">
                                            <select name="isDisable" ng-model="searchRequest.isDisable" ng-options="option.isDisable as option.name for option in isDisableOptions" class="form-control input-sm" required>
                                                <option value="">--状态--</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <select name="isDeveloper" ng-model="searchRequest.isDeveloper" ng-options="option.isDeveloper as option.name for option in isDeveloperOptions" class="form-control input-sm" required>
                                                <option value="">--角色--</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <button type="button" class="btn btn-info btn-sm" ng-click="search({'page':1});">搜索</button>
                                        </div>
                                    </form>
                                    <br/>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table class="table table-condensed table-hover">
                                        <thead>
                                        <tr class="active">
                                            <th width="30" align="center">#</th>
                                            <th width="150">ID<span class="glyphicon glyphicon-sort-by-attributes-alt text-info" aria-hidden="true"></span></th>
                                            <th width="150">用户名</th>
                                            <th width="100">状态</th>
                                            <th width="100">角色</th>
                                            <th width="100">登录次数</th>
                                            <th width="150">创建者</th>
                                            <th width="150">创建日期</th>
                                            <th width="150">修改日期</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="user in pagerResult.records track by $index">
                                            <th>{{$index + 1}}</th>
                                            <td>{{user.id}}</td>
                                            <td>{{user.userName}}</td>
                                            <td>{{user.isDisable ? "冻结" : "激活"}}</td>
                                            <td>{{user.isDeveloper ? "开发者" : "使用者";}}</td>
                                            <td>{{user.loginCount}}</td>
                                            <td>{{user.creator ? user.creator.userName : '系统'}}</td>
                                            <td>{{user.createDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td>{{user.modifyDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td><a class="btn btn-info btn-sm" ng-href="#/business/user/detail/{{user.id}}" role="button" target="_blank">详情</a></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                            <div class="col-sm-12">
                                <div class="pull-left">
                                    <ul class="pagination pagination-sm">
                                        <li ng-class="{'active': searchRequest.pageSize==pageSize}" ng-repeat="pageSize in [10, 20, 50]" ><a href="javascript:void(0);" ng-click="(searchRequest.pageSize!=pageSize)&&search({'pageSize':pageSize,'page':1});">{{pageSize}}</a></li>
                                    </ul>
                                </div>
                                <div class="pull-left">
                                    &nbsp;<uib-pagination class="pagination-sm" boundary-links="true" rotate="false" max-size="10" total-items="pagerResult.total" ng-model="searchRequest.page" ng-change="search();" items-per-page="searchRequest.pageSize" first-text="首页" previous-text="上页" next-text="下页" last-text="尾页"></uib-pagination>
                                </div>
                                <div class="pull-left form-control-static clearfix">&nbsp;共&nbsp;{{pagerResult.total ? pagerResult.total : 0}}&nbsp;条</div>
                            </div>
                        </div>
                        </div>
                    </uib-tab>
                    <uib-tab select="select('generatorInstance')">
                        <uib-tab-heading><label>生成实例</label> <label class="badge">{{result.generatorInstanceCount}}</label></uib-tab-heading>
                        <br/>
                        <div ng-controller="statisticGeneratorInstanceController">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline">
                                        <div class="form-group">
                                            <input name="name" type="text" class="form-control input-sm" ng-model="searchRequest.name" placeholder="名称"/>
                                        </div>
                                        <div class="form-group">
                                            <button type="button" class="btn btn-info btn-sm" ng-click="search({'page':1});">搜索</button>
                                        </div>
                                    </form>
                                    <br/>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table class="table table-condensed table-hover">
                                        <thead>
                                        <tr class="active">
                                            <th width="30">#</th>
                                            <th width="150">ID<span class="glyphicon glyphicon-sort-by-attributes-alt text-info" aria-hidden="true"></span></th>
                                            <th width="200">名称</th>
                                            <th width="200">生成器</th>
                                            <th width="150">创建者</th>
                                            <th width="150">创建日期</th>
                                            <th width="150">修改日期</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="generatorInstance in pagerResult.records track by $index">
                                            <th>{{$index + 1}}</th>
                                            <td>{{generatorInstance.id}}</td>
                                            <td>{{generatorInstance.name}}</td>
                                            <td>{{generatorInstance.generator.name}}</td>
                                            <td>{{generatorInstance.user.userName}}</td>
                                            <td>{{generatorInstance.createDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td>{{generatorInstance.modifyDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td><a class="btn btn-info btn-sm" ng-href="#/business/generatorInstance/detail/{{generatorInstance.id}}" role="button" target="_blank">详情</a></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="pull-left">
                                        <ul class="pagination pagination-sm">
                                            <li ng-class="{'active': searchRequest.pageSize==pageSize}" ng-repeat="pageSize in [10, 20, 50]" ><a href="javascript:void(0);" ng-click="(searchRequest.pageSize!=pageSize)&&search({'pageSize':pageSize,'page':1});">{{pageSize}}</a></li>
                                        </ul>
                                    </div>
                                    <div class="pull-left">
                                        &nbsp;<uib-pagination class="pagination-sm" boundary-links="true" rotate="false" max-size="10" total-items="pagerResult.total" ng-model="searchRequest.page" ng-change="search();" items-per-page="searchRequest.pageSize" first-text="首页" previous-text="上页" next-text="下页" last-text="尾页"></uib-pagination>
                                    </div>
                                    <div class="pull-left form-control-static clearfix">&nbsp;共&nbsp;{{pagerResult.total ? pagerResult.total : 0}}&nbsp;条</div>
                                </div>
                            </div>
                        </div>
                    </uib-tab>
                    <uib-tab select="select('generator')">
                        <uib-tab-heading><label>生成器</label> <label class="badge">{{result.generatorCount}}</label></uib-tab-heading>
                        <br/>
                        <div ng-controller="statisticGeneratorController">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline">
                                        <div class="form-group">
                                            <input name="name" type="text" class="form-control input-sm" ng-model="searchRequest.name" placeholder="名称"/>
                                        </div>
                                        <div class="form-group">
                                            <select name="status" ng-model="searchRequest.isOpen" ng-options="status.isOpen as status.name for status in statuses" class="form-control input-sm" required>
                                                <option value="">--状态--</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <button type="button" class="btn btn-info btn-sm" ng-click="search({'page':1});">搜索</button>
                                        </div>
                                    </form>
                                    <br/>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table class="table table-condensed table-hover">
                                        <thead>
                                        <tr class="active">
                                            <th width="30">#</th>
                                            <th width="150">ID<span class="glyphicon glyphicon-sort-by-attributes-alt text-info" aria-hidden="true"></span></th>
                                            <th width="200">名称</th>
                                            <th width="100">状态</th>
                                            <th width="100">实例量</th>
                                            <th width="150">创建者</th>
                                            <th width="150">创建日期</th>
                                            <th width="150">修改日期</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="generator in pagerResult.records track by $index">
                                            <th>{{$index + 1}}</th>
                                            <td>{{generator.id}}</td>
                                            <td>{{generator.name}}</td>
                                            <td>{{generator.isOpen ? "发布" : "维护";}}</td>
                                            <td>{{generator.instanceCount}}</td>
                                            <td>{{generator.developer.userName}}</td>
                                            <td>{{generator.createDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td>{{generator.modifyDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td><a class="btn btn-info btn-sm" ng-href="#/business/generator/detail/{{generator.id}}" role="button" target="_blank">详情</a></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="pull-left">
                                        <ul class="pagination pagination-sm">
                                            <li ng-class="{'active': searchRequest.pageSize==pageSize}" ng-repeat="pageSize in [10, 20, 50]" ><a href="javascript:void(0);" ng-click="(searchRequest.pageSize!=pageSize)&&search({'pageSize':pageSize,'page':1});">{{pageSize}}</a></li>
                                        </ul>
                                    </div>
                                    <div class="pull-left">
                                        &nbsp;<uib-pagination class="pagination-sm" boundary-links="true" rotate="false" max-size="10" total-items="pagerResult.total" ng-model="searchRequest.page" ng-change="search();" items-per-page="searchRequest.pageSize" first-text="首页" previous-text="上页" next-text="下页" last-text="尾页"></uib-pagination>
                                    </div>
                                    <div class="pull-left form-control-static clearfix">&nbsp;共&nbsp;{{pagerResult.total ? pagerResult.total : 0}}&nbsp;条</div>
                                </div>
                            </div>
                        </div>
                    </uib-tab>
                    <uib-tab select="select('dynamicModel')">
                        <uib-tab-heading><label>数据模型</label> <label class="badge">{{result.dynamicModelCount}}</label></uib-tab-heading>
                        <br/>
                        <div ng-controller="statisticDynamicModelController">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline">
                                        <div class="form-group">
                                            <input name="name" type="text" class="form-control input-sm" ng-model="searchRequest.name" placeholder="名称"/>
                                        </div>
                                        <div class="form-group">
                                            <button type="button" class="btn btn-info btn-sm" ng-click="search({'page':1});">搜索</button>
                                        </div>
                                    </form>
                                    <br/>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table class="table table-condensed table-hover">
                                        <thead>
                                        <tr class="active">
                                            <th width="30">#</th>
                                            <th width="150">ID<span class="glyphicon glyphicon-sort-by-attributes-alt text-info" aria-hidden="true"></span></th>
                                            <th width="200">名称</th>
                                            <th width="100">图标</th>
                                            <th width="200">生成器</th>
                                            <th width="150">创建者</th>
                                            <th width="150">创建日期</th>
                                            <th width="150">修改日期</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="dynamicModel in pagerResult.records track by $index">
                                            <th>{{$index + 1}}</th>
                                            <td>{{dynamicModel.id}}</td>
                                            <td>{{dynamicModel.name}}</td>
                                            <td><span class="glyphicon glyphicon-{{dynamicModel.icon}}"></span></td>
                                            <td>{{dynamicModel.generator.name}}</td>
                                            <td>{{dynamicModel.developer.userName}}</td>
                                            <td>{{dynamicModel.createDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td>{{dynamicModel.modifyDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td><a class="btn btn-info btn-sm" ng-href="#/business/dynamicModel/detail/{{dynamicModel.id}}" role="button" target="_blank">详情</a></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="pull-left">
                                        <ul class="pagination pagination-sm">
                                            <li ng-class="{'active': searchRequest.pageSize==pageSize}" ng-repeat="pageSize in [10, 20, 50]" ><a href="javascript:void(0);" ng-click="(searchRequest.pageSize!=pageSize)&&search({'pageSize':pageSize,'page':1});">{{pageSize}}</a></li>
                                        </ul>
                                    </div>
                                    <div class="pull-left">
                                        &nbsp;<uib-pagination class="pagination-sm" boundary-links="true" rotate="false" max-size="10" total-items="pagerResult.total" ng-model="searchRequest.page" ng-change="search();" items-per-page="searchRequest.pageSize" first-text="首页" previous-text="上页" next-text="下页" last-text="尾页"></uib-pagination>
                                    </div>
                                    <div class="pull-left form-control-static clearfix">&nbsp;共&nbsp;{{pagerResult.total ? pagerResult.total : 0}}&nbsp;条</div>
                                </div>
                            </div>
                        </div>
                    </uib-tab>
                    <uib-tab select="select('template')">
                        <uib-tab-heading><label>模板文件</label> <label class="badge">{{result.templateCount}}</label></uib-tab-heading>
                        <br/>
                        <div ng-controller="statisticTemplateController">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline">
                                        <div class="form-group">
                                            <input name="name" type="text" class="form-control input-sm" ng-model="searchRequest.name" placeholder="名称"/>
                                        </div>
                                        <div class="form-group">
                                            <button type="button" class="btn btn-info btn-sm" ng-click="search({'page':1});">搜索</button>
                                        </div>
                                    </form>
                                    <br/>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table class="table table-condensed table-hover">
                                        <thead>
                                        <tr class="active">
                                            <th width="30">#</th>
                                            <th width="150">ID<span class="glyphicon glyphicon-sort-by-attributes-alt text-info" aria-hidden="true"></span></th>
                                            <th width="200">名称</th>
                                            <th width="200">生成器</th>
                                            <th width="150">创建者</th>
                                            <th width="150">创建日期</th>
                                            <th width="150">修改日期</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="template in pagerResult.records track by $index">
                                            <th>{{$index + 1}}</th>
                                            <td>{{template.id}}</td>
                                            <td>{{template.name}}</td>
                                            <td>{{template.generator.name}}</td>
                                            <td>{{template.developer.userName}}</td>
                                            <td>{{template.createDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td>{{template.modifyDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td><a class="btn btn-info btn-sm" ng-href="#/business/template/detail/{{template.id}}" role="button" target="_blank">详情</a></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="pull-left">
                                        <ul class="pagination pagination-sm">
                                            <li ng-class="{'active': searchRequest.pageSize==pageSize}" ng-repeat="pageSize in [10, 20, 50]" ><a href="javascript:void(0);" ng-click="(searchRequest.pageSize!=pageSize)&&search({'pageSize':pageSize,'page':1});">{{pageSize}}</a></li>
                                        </ul>
                                    </div>
                                    <div class="pull-left">
                                        &nbsp;<uib-pagination class="pagination-sm" boundary-links="true" rotate="false" max-size="10" total-items="pagerResult.total" ng-model="searchRequest.page" ng-change="search();" items-per-page="searchRequest.pageSize" first-text="首页" previous-text="上页" next-text="下页" last-text="尾页"></uib-pagination>
                                    </div>
                                    <div class="pull-left form-control-static clearfix">&nbsp;共&nbsp;{{pagerResult.total ? pagerResult.total : 0}}&nbsp;条</div>
                                </div>
                            </div>
                        </div>
                    </uib-tab>
                    <uib-tab select="select('templateStrategy')">
                        <uib-tab-heading><label>生成策略</label> <label class="badge">{{result.templateStrategyCount}}</label></uib-tab-heading>
                        <br/>
                        <div ng-controller="statisticTemplateStrategyController">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline">
                                        <div class="form-group">
                                            <input name="name" type="text" class="form-control input-sm" ng-model="searchRequest.name" placeholder="名称"/>
                                        </div>
                                        <div class="form-group">
                                            <button type="button" class="btn btn-info btn-sm" ng-click="search({'page':1});">搜索</button>
                                        </div>
                                    </form>
                                    <br/>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table class="table table-condensed table-hover">
                                        <thead>
                                        <tr class="active">
                                            <th width="30">#</th>
                                            <th width="150">ID<span class="glyphicon glyphicon-sort-by-attributes-alt text-info" aria-hidden="true"></span></th>
                                            <th width="200">名称</th>
                                            <th width="200">生成器</th>
                                            <th width="150">创建者</th>
                                            <th width="150">创建日期</th>
                                            <th width="150">修改日期</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="templateStrategy in pagerResult.records track by $index">
                                            <th>{{$index + 1}}</th>
                                            <td>{{templateStrategy.id}}</td>
                                            <td>{{templateStrategy.name}}</td>
                                            <td>{{templateStrategy.generator.name}}</td>
                                            <td>{{templateStrategy.developer.userName}}</td>
                                            <td>{{templateStrategy.createDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td>{{templateStrategy.modifyDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                                            <td><a class="btn btn-info btn-sm" ng-href="#/business/templateStrategy/detail/{{templateStrategy.id}}" role="button" target="_blank">详情</a></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="pull-left">
                                        <ul class="pagination pagination-sm">
                                            <li ng-class="{'active': searchRequest.pageSize==pageSize}" ng-repeat="pageSize in [10, 20, 50]" ><a href="javascript:void(0);" ng-click="(searchRequest.pageSize!=pageSize)&&search({'pageSize':pageSize,'page':1});">{{pageSize}}</a></li>
                                        </ul>
                                    </div>
                                    <div class="pull-left">
                                        &nbsp;<uib-pagination class="pagination-sm" boundary-links="true" rotate="false" max-size="10" total-items="pagerResult.total" ng-model="searchRequest.page" ng-change="search();" items-per-page="searchRequest.pageSize" first-text="首页" previous-text="上页" next-text="下页" last-text="尾页"></uib-pagination>
                                    </div>
                                    <div class="pull-left form-control-static clearfix">&nbsp;共&nbsp;{{pagerResult.total ? pagerResult.total : 0}}&nbsp;条</div>
                                </div>
                            </div>
                        </div>
                    </uib-tab>
                </uib-tabset>
            </div>
        </div>
    </div>
</div>